#!/usr/bin/perl
use DBI;
my $dbh=DBI->connect("DBI:mysql:csworld:127.0.0.1",'tonberry','kewlnet');
my $sth = $dbh->prepare("SELECT * FROM nicks;");
my $db2 =DBI->connect("DBI:mysql:nicolas:www.freesql.org",'nicolas','tonberry');
my $st2;
while (my @row = $sth->fetchrow_array) {
$st2=$db2->prepare("INSERT INTO nicks VALUES ('$row[0]','$row[1]','$row[2]','$row[3]','$row[4]','$row[5]','$row[6]';");
}
$st2->execute;
$dbh->disconnect;
$st2->disconnect
